package com.hdu.point_offer;

public class lcr185 {
    class Solution {
        public double[] statisticsProbability(int num) {
            int[][] dp = new int[num + 1][num * 6 + 1];
            for (int i = 1; i <= 6; i++)
            {
                dp[1][i] = 1;
            }
            for (int i = 2; i <= num; i++)
            {
                for (int j = i; j <= i * 6; j++)
                {
                    for (int k = 1; k <= 6; k++)
                    {
                        if (j > k)
                        {
                            dp[i][j] += dp[i - 1][j - k];
                        }
                    }
                }
            }
            int total = (int) Math.pow(6, num);
            double[] ans = new double[5 * num + 1];
            int index = 0;
            for (int i = num; i <= num * 6; i++)
            {
                ans[index++] = (double) dp[num][i] / total;
            }
            return ans;
        }
    }
}
